//设置导航栏标题
export const setNavTitle = function(title){//设置当前页面的标题
	uni.setNavigationBarTitle({
		title: title
	});
}
export const AdministrationImage={
	companyTitle:'易租云科技',
	companyLogo:'/20220401/318576b131bb4779b57e5d7902c2c372.jpg',
	officialImg:uni.$u.http.config.baseURL+'/DOC20221029000088',
	IfTowOfficial:false,
	TicketsSeeImg:uni.$u.http.config.baseURL+getApp().globalData.NewIconUrl+'DOC20221018000046',
		
	// companyTitle:'海逸南海新经济小镇',
	// companyLogo:'/20220615/eeedb7040214499f8c91b61a166dae8f.png',
	// officialImg:'/20220705/bbe04e469e8948f2bb04ca14c9b00189.png',
	// IfTowOfficial:true,
	//TicketsSeeImg:uni.$u.http.config.baseURL+getApp().globalData.NewIconUrl+'/DOC20221020000050',
}
//navigateTo 路由跳转
export const skipPage=function(url){
	uni.navigateTo({
		url:url
	})
}
export const saveSuccessMethods=function(){
	uni.$u.toast('保存成功','success',function(){
		uni.navigateBack({
			delta: 1,
		})
	})
}
export const againLogin=function(res){//重新登录 --上传图片时用到
	if(res.code==403||res.code==401){
		uni.showModal({
			title: '提示',
			confirmText: "去登录", // 确认按钮的文字 
			showCancel:false,
			content: "登录过期，请重新登录",
			complete() {
				uni.$u.route('/subpkg/simplePage/simplePage', {
					title: '登录',
					IfonShow: 'true'
				});
			}
		})
	}else{
		uni.$u.toast(res.msg)
	}
}
// 获取当前时间
export const getNowDate=function(type) {
  let date = new Date();
  let year = date.getFullYear();//  返回的是年份
  let month = (date.getMonth() + 1)>9 ? (date.getMonth() + 1) : '0'+(date.getMonth() + 1);//  返回的月份上个月的月份，记得+1才是当月
  let dates = date.getDate()>9 ? date.getDate() : '0'+date.getDate();//  返回的是几号
  let h = date.getHours()>9 ?date.getHours() :'0'+date.getHours();//获取当前小时        
  let m = date.getMinutes()>9 ?date.getMinutes() :'0'+date.getMinutes()//获取当前分钟
  let s = date.getSeconds()>9 ?date.getSeconds() :'0'+date.getSeconds()//获取当前秒钟
  if(type=='年月日'){
     return `${year}-${month}-${dates}`
  }else if(type=='年月'){
      return `${year}-${month}`
  }else if(type=='时分秒'){
     return `${h}:${m}:${s}`
  }else if(type=='时分'){
      return `${h}:${m}`
  }else if(type=='年月日时分秒'){
      return `${year}-${month}-${dates} ${h}:${m}:${s}`
  }
} 